<template>
  <div>
    <el-dialog :title="dialogName" top="5vh" width="40%" :before-close="handleClose" :visible.sync="UserManageVisible">
      <el-form ref="userAddData" :model="userAddData" :rules="rules" size="small" label-width="100px">
        <el-form-item label="账号" prop="userName">
          <el-input v-model.trim="userAddData.userName" placeholder="请输入账号" />
        </el-form-item>
        <el-form-item label="用户名" prop="userNo">
          <el-input v-model.trim="userAddData.userNo" placeholder="请输入用户名" />
        </el-form-item>
        <el-form-item v-if="adddialogbutton" label="密码" prop="password">
          <el-input v-model.trim="userAddData.password" show-password placeholder="请输入密码" />
        </el-form-item>
        <el-form-item v-if="adddialogbutton" label="确认密码" prop="checkPassword">
          <el-input v-model.trim="userAddData.checkPassword" show-password placeholder="确认密码" />
        </el-form-item>
        <el-form-item v-if="editdialogbutton && changePassword" label="密码" prop="password">
          <el-input v-if="changePassword" v-model.trim="userAddData.password" show-password placeholder="密码" />
        </el-form-item>
        <el-form-item v-if="editdialogbutton && changePassword" label="确认密码" prop="checkPassword">
          <el-input v-if="changePassword" v-model.trim="userAddData.checkPassword" show-password placeholder="确认密码" />
        </el-form-item>
        <el-form-item v-if="editdialogbutton &&!changePassword">
          <el-button v-if="!changePassword" @click="changePassword = true">修改密码</el-button>
        </el-form-item>
        <el-form-item label="角色" prop="roleId">
          <el-select v-model="userAddData.roleId" placeholder="请选择角色">
            <el-option v-for="item in roleList" :key="item.id" :label="item.roleName" :value="item.id" />
          </el-select>
        </el-form-item>
        <el-form-item>
          <el-button v-if="adddialogbutton" type="primary" plain size="medium" @click="addUserConfirm">确认</el-button>
          <el-button v-if="editdialogbutton" type="primary" plain size="medium" @click="editUserConfirm">修改</el-button>
          <el-button size="medium" @click="handleClose">取消</el-button>
        </el-form-item>
      </el-form>
    </el-dialog>
  </div>
</template>

<script>
export default {};
</script>

<style>
</style>
